@use './variables.scss' as vars;
@use './reset.scss';

/* 全局样式 */

// 通用内边距
.p-10 {
  padding: 10px;
}

.p-15 {
  padding: 15px;
}

.p-20 {
  padding: 20px;
}

// 通用外边距
.m-10 {
  margin: 10px;
}

.m-15 {
  margin: 15px;
}

.m-20 {
  margin: 20px;
}

// 上下外边距
.my-10 {
  margin-top: 10px;
  margin-bottom: 10px;
}

.my-15 {
  margin-top: 15px;
  margin-bottom: 15px;
}

.my-20 {
  margin-top: 20px;
  margin-bottom: 20px;
}

// 左右外边距
.mx-10 {
  margin-left: 10px;
  margin-right: 10px;
}

.mx-15 {
  margin-left: 15px;
  margin-right: 15px;
}

.mx-20 {
  margin-left: 20px;
  margin-right: 20px;
}

// 单独外边距
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.ml-20 { margin-left: 20px; }

.mr-10 { margin-right: 10px; }
.mr-15 { margin-right: 15px; }
.mr-20 { margin-right: 20px; }

// 弹性布局
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.align-center {
  align-items: center;
}

.align-stretch {
  align-items: stretch;
}

// 文本对齐
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

// 文本颜色
.text-primary {
  color: vars.$primary-color;
}

.text-success {
  color: vars.$success-color;
}

.text-warning {
  color: vars.$warning-color;
}

.text-danger {
  color: vars.$danger-color;
}

.text-info {
  color: vars.$info-color;
}

// 背景颜色
.bg-primary {
  background-color: vars.$primary-color;
}

.bg-success {
  background-color: vars.$success-color;
}

.bg-warning {
  background-color: vars.$warning-color;
}

.bg-danger {
  background-color: vars.$danger-color;
}

.bg-info {
  background-color: vars.$info-color;
}

// 阴影
.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

// 圆角
.rounded-sm {
  border-radius: 2px;
}

.rounded {
  border-radius: 4px;
}

.rounded-lg {
  border-radius: 8px;
}

.rounded-full {
  border-radius: 9999px;
}

// App 容器样式
.app-container {
  padding: 20px;
}

// 全屏容器
.fullscreen-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

// 页面过渡动画
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

// 常用的表格样式
.bs-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  
  th, td {
    padding: 12px 8px;
    border-bottom: 1px solid vars.$border-lighter;
  }
  
  th {
    text-align: left;
    font-weight: 500;
    color: vars.$text-regular;
    background-color: vars.$background-base;
  }
  
  tr:hover td {
    background-color: vars.$background-base;
  }
}

// 响应式容器
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;

  @media (min-width: 576px) {
    max-width: 540px;
  }
  
  @media (min-width: 768px) {
    max-width: 720px;
  }
  
  @media (min-width: 992px) {
    max-width: 960px;
  }
  
  @media (min-width: 1200px) {
    max-width: 1140px;
  }
}

// 全局通用样式
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
  font-size: vars.$font-size-base;
  color: vars.$text-primary;
  background-color: vars.$background-base;
}

#app {
  height: 100%;
}

.container {
  padding: vars.$spacing-md;
}

// 布局相关
.page-header {
  margin-bottom: vars.$spacing-md;
  padding: vars.$spacing-md 0;
  border-bottom: 1px solid vars.$border-lighter;
}

.page-content {
  padding: vars.$spacing-md;
  background-color: #fff;
  border-radius: vars.$border-radius-base;
}

// 常用辅助类
.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

.mt-1 {
  margin-top: vars.$spacing-xs;
}

.mr-1 {
  margin-right: vars.$spacing-xs;
}

.mb-1 {
  margin-bottom: vars.$spacing-xs;
}

.ml-1 {
  margin-left: vars.$spacing-xs;
}

.mt-2 {
  margin-top: vars.$spacing-sm;
}

.mr-2 {
  margin-right: vars.$spacing-sm;
}

.mb-2 {
  margin-bottom: vars.$spacing-sm;
}

.ml-2 {
  margin-left: vars.$spacing-sm;
}

.mt-3 {
  margin-top: vars.$spacing-md;
}

.mr-3 {
  margin-right: vars.$spacing-md;
}

.mb-3 {
  margin-bottom: vars.$spacing-md;
}

.ml-3 {
  margin-left: vars.$spacing-md;
}

.pt-1 {
  padding-top: vars.$spacing-xs;
}

.pr-1 {
  padding-right: vars.$spacing-xs;
}

.pb-1 {
  padding-bottom: vars.$spacing-xs;
}

.pl-1 {
  padding-left: vars.$spacing-xs;
}

.pt-2 {
  padding-top: vars.$spacing-sm;
}

.pr-2 {
  padding-right: vars.$spacing-sm;
}

.pb-2 {
  padding-bottom: vars.$spacing-sm;
}

.pl-2 {
  padding-left: vars.$spacing-sm;
}

.pt-3 {
  padding-top: vars.$spacing-md;
}

.pr-3 {
  padding-right: vars.$spacing-md;
}

.pb-3 {
  padding-bottom: vars.$spacing-md;
}

.pl-3 {
  padding-left: vars.$spacing-md;
}

// 弹性布局
.d-flex {
  display: flex;
}

.flex-1 {
  flex: 1;
} 